<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>修改标签</title>
    <link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/form.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/blog.css" rel="stylesheet" type="text/css"/>
  </head>
  <body>
    <form name="blogTagsForm" id="blogTagsForm" action="<%=path%>/daily/blogTags/update.t4m" class="form" method="post">
      <s:hidden name="blogTags.id"/>
      <table class="form-table" cellspacing="0" cellpadding="0">
        <tr>
          <td class="form-left"><span class="form-required">*</span>标签名称</td>
          <td class="form-right"><s:textfield id="blogTagsName" name="blogTags.name" cssClass="text"/></td>
        </tr>
        <tr>
          <td class="form-left"><span class="form-required">*</span>标签颜色</td>
          <td class="form-right">
            <s:hidden id="blogTagsColor" name="blogTags.color"/>
            <s:iterator id="colorValue" value="@com.voa.constants.OAStringConstants@colorList">
              <s:if test="blogTags.color == #colorValue">
                <div class="color-rect color-selected" style="background-color:<s:property value="#colorValue"/>;">&nbsp;</div>
              </s:if>
              <s:else>
                <div class="color-rect" color="<s:property/>" style="background-color:<s:property value="#colorValue"/>;">&nbsp;</div>
              </s:else>
            </s:iterator>
          </td>
        </tr>
      </table>
      <s:hidden name="tabId"/>
      <s:hidden name="windowPanelId"/>
    </form>
    <script src="<%=path%>/js/core.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
    <script src="<%=path%>/js/Validate.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function(){
      addValidate('blogTagsColor', [{type:'canNull', value:'F', message:'必须选择标签颜色'}]);
      addValidate('blogTagsName', [{type:'canNull', value:'F', message:'必须填写标签名称'}]);
      
      var colors = $('.color-rect');
      colors.click(function(){
        $('#blogTagsColor').val($(this).attr('color').toUpperCase());
        $('.color-selected').removeClass('color-selected');
        $(this).addClass('color-selected');
      });
    });
    </script>
  </body>
</html>